﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:cvt="clr-namespace:GiveAQuiz.Common.Converters"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
                    xmlns:System="clr-namespace:System;assembly=mscorlib"
                    mc:Ignorable="d">

  <cvt:VisibilityConverter x:Key="visibilityConverter" />
  <cvt:VisibilityNullConverter x:Key="visibilityNullConverter" />
  <LinearGradientBrush x:Key="greyButtonBack"
                       EndPoint="0.5,1"
                       StartPoint="0.5,0">
    <GradientStop Color="#FF666666" />
    <GradientStop Color="#FF555555"
                  Offset="0.5" />
    <GradientStop Color="#FF626262"
                  Offset="0.53" />
    <GradientStop Color="#FF666666"
                  Offset="0.995" />
  </LinearGradientBrush>
  <Color x:Key="outlineColor">#FF5F5F61</Color>
  <Style TargetType="Border"
         x:Name="standardBorder">
    <Setter Property="BorderThickness"
            Value="1" />
    <Setter Property="BorderBrush">
      <Setter.Value>
        <SolidColorBrush Color="{StaticResource outlineColor}" />
      </Setter.Value>
    </Setter>
    <Setter Property="Padding"
            Value="0" />
  </Style>
  <Style TargetType="Rectangle"
         x:Key="busyIndicatorBack">
    <Setter Property="Fill"
            Value="{StaticResource outlineColor}" />
    <Setter Property="Opacity"
            Value="0.75" />
  </Style>
  <Style TargetType="ProgressBar"
         x:Key="busyIndicatorProgressBar">
    <Setter Property="Visibility"
            Value="Collapsed" />
  </Style>
  <Style TargetType="Button"
         x:Key="baseButton">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Button">
          <Grid>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimation Duration="0"
                                     To="0"
                                     Storyboard.TargetProperty="(UIElement.Opacity)"
                                     Storyboard.TargetName="rectangle1"
                                     d:IsOptimized="True" />
                    <DoubleAnimation Duration="0"
                                     To="0.5"
                                     Storyboard.TargetProperty="(UIElement.Opacity)"
                                     Storyboard.TargetName="contentPresenter"
                                     d:IsOptimized="True" />
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Normal" />
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <ColorAnimation Duration="0"
                                    To="#FF3364B2"
                                    Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"
                                    Storyboard.TargetName="rectangle"
                                    d:IsOptimized="True" />
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Pressed">
                  <Storyboard>
                    <ColorAnimation Duration="0"
                                    To="#FFFFA400"
                                    Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"
                                    Storyboard.TargetName="rectangle"
                                    d:IsOptimized="True" />
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle x:Name="rectangle"
                       Stroke="#FF666666"
                       Fill="#FF555555"
                       RadiusX="3"
                       RadiusY="3" />
            <Rectangle x:Name="rectangle1"
                       Stroke="#FF666666"
                       Opacity="0.5"
                       RadiusX="3"
                       RadiusY="3">
              <Rectangle.Fill>
                <LinearGradientBrush EndPoint="0.5,1"
                                     StartPoint="0.5,0">
                  <GradientStop Color="#FF979797" />
                  <GradientStop Color="Black"
                                Offset="0.512" />
                  <GradientStop Color="#FF8D8D8D"
                                Offset="0.5" />
                  <GradientStop Offset="0.995"
                                Color="#FF838383" />
                </LinearGradientBrush>
              </Rectangle.Fill>
            </Rectangle>
            <ContentPresenter x:Name="contentPresenter"
                              Margin="16 6"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                              Content="{TemplateBinding Content}" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="Foreground"
            Value="White" />
    <Setter Property="FontWeight"
            Value="Normal" />
  </Style>
  <Style TargetType="Button"
         BasedOn="{StaticResource baseButton}" />
  <Style x:Key="ImageButton"
         TargetType="Button">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Button">
          <Grid Background="Transparent">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition GeneratedDuration="0:0:0.1" />
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimation Duration="0"
                                     To="0.25"
                                     Storyboard.TargetProperty="(UIElement.Opacity)"
                                     Storyboard.TargetName="contentPresenter"
                                     d:IsOptimized="True" />
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Normal" />
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimation Duration="0"
                                     To="2"
                                     Storyboard.TargetProperty="(UIElement.Effect).(DropShadowEffect.ShadowDepth)"
                                     Storyboard.TargetName="contentPresenter"
                                     d:IsOptimized="True" />
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Pressed">
                  <Storyboard>
                    <DoubleAnimation Duration="0"
                                     To="0"
                                     Storyboard.TargetProperty="(UIElement.Effect).(DropShadowEffect.ShadowDepth)"
                                     Storyboard.TargetName="contentPresenter"
                                     d:IsOptimized="True" />
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <ContentPresenter x:Name="contentPresenter"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
              <ContentPresenter.Effect>
                <DropShadowEffect ShadowDepth="1" />
              </ContentPresenter.Effect>
            </ContentPresenter>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="toolkit:TransitioningContentControl">
    <Setter Property="IsTabStop"
            Value="True" />
    <Setter Property="HorizontalContentAlignment"
            Value="Left" />
    <Setter Property="VerticalContentAlignment"
            Value="Top" />
    <Setter Property="Transition"
            Value="DefaultTransition" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="toolkit:TransitioningContentControl">
          <Border BorderBrush="{TemplateBinding BorderBrush}"
                  BorderThickness="{TemplateBinding BorderThickness}"
                  Background="{TemplateBinding Background}"
                  CornerRadius="2">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="PresentationStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition GeneratedDuration="0:0:0" />
                </VisualStateGroup.Transitions>
                <VisualState x:Name="DefaultTransition">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                   Storyboard.TargetProperty="(UIElement.Opacity)"
                                                   Storyboard.TargetName="CurrentContentPresentationSite">
                      <SplineDoubleKeyFrame KeyTime="00:00:00"
                                            Value="0" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.500"
                                            Value="1" />
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                   Storyboard.TargetProperty="(UIElement.Opacity)"
                                                   Storyboard.TargetName="PreviousContentPresentationSite">
                      <SplineDoubleKeyFrame KeyTime="00:00:00"
                                            Value="1" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.500"
                                            Value="0" />
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Normal">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames BeginTime="00:00:00"
                                                   Storyboard.TargetProperty="(UIElement.Visibility)"
                                                   Storyboard.TargetName="PreviousContentPresentationSite">
                      <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="UpTransition">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                   Storyboard.TargetProperty="(UIElement.Opacity)"
                                                   Storyboard.TargetName="CurrentContentPresentationSite">
                      <SplineDoubleKeyFrame KeyTime="00:00:00"
                                            Value="0" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.300"
                                            Value="1" />
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                   Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)"
                                                   Storyboard.TargetName="CurrentContentPresentationSite">
                      <SplineDoubleKeyFrame KeyTime="00:00:00"
                                            Value="30" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.300"
                                            Value="0" />
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                   Storyboard.TargetProperty="(UIElement.Opacity)"
                                                   Storyboard.TargetName="PreviousContentPresentationSite">
                      <SplineDoubleKeyFrame KeyTime="00:00:00"
                                            Value="1" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.300"
                                            Value="0" />
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                   Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)"
                                                   Storyboard.TargetName="PreviousContentPresentationSite">
                      <SplineDoubleKeyFrame KeyTime="00:00:00"
                                            Value="0" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.300"
                                            Value="-30" />
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="DownTransition">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                   Storyboard.TargetProperty="(UIElement.Opacity)"
                                                   Storyboard.TargetName="CurrentContentPresentationSite">
                      <SplineDoubleKeyFrame KeyTime="00:00:00"
                                            Value="0" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.500"
                                            Value="1" />
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                   Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)"
                                                   Storyboard.TargetName="CurrentContentPresentationSite">
                      <SplineDoubleKeyFrame KeyTime="00:00:00"
                                            Value="-40" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.500"
                                            Value="0" />
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                   Storyboard.TargetProperty="(UIElement.Opacity)"
                                                   Storyboard.TargetName="PreviousContentPresentationSite">
                      <SplineDoubleKeyFrame KeyTime="00:00:00"
                                            Value="1" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.500"
                                            Value="0" />
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                   Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)"
                                                   Storyboard.TargetName="PreviousContentPresentationSite">
                      <SplineDoubleKeyFrame KeyTime="00:00:00"
                                            Value="0" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.500"
                                            Value="40" />
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid>
              <ContentPresenter x:Name="PreviousContentPresentationSite"
                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                Content="{x:Null}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                <ContentPresenter.RenderTransform>
                  <TransformGroup>
                    <ScaleTransform />
                    <SkewTransform />
                    <RotateTransform />
                    <TranslateTransform />
                  </TransformGroup>
                </ContentPresenter.RenderTransform>
              </ContentPresenter>
              <ContentPresenter x:Name="CurrentContentPresentationSite"
                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                Content="{x:Null}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                <ContentPresenter.RenderTransform>
                  <TransformGroup>
                    <ScaleTransform />
                    <SkewTransform />
                    <RotateTransform />
                    <TranslateTransform />
                  </TransformGroup>
                </ContentPresenter.RenderTransform>
              </ContentPresenter>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <ControlTemplate x:Key="ValidationToolTipTemplate">
    <Grid x:Name="Root"
          Margin="5,0"
          Opacity="0"
          RenderTransformOrigin="0,0">
      <Grid.RenderTransform>
        <TranslateTransform x:Name="xform"
                            X="-25" />
      </Grid.RenderTransform>
      <VisualStateManager.VisualStateGroups>
        <VisualStateGroup x:Name="OpenStates">
          <VisualStateGroup.Transitions>
            <VisualTransition GeneratedDuration="0" />
            <VisualTransition GeneratedDuration="0:0:0.2"
                              To="Open">
              <Storyboard>
                <DoubleAnimation Duration="0:0:0.2"
                                 To="0"
                                 Storyboard.TargetProperty="X"
                                 Storyboard.TargetName="xform">
                  <DoubleAnimation.EasingFunction>
                    <BackEase Amplitude=".3"
                              EasingMode="EaseOut" />
                  </DoubleAnimation.EasingFunction>
                </DoubleAnimation>
                <DoubleAnimation Duration="0:0:0.2"
                                 To="1"
                                 Storyboard.TargetProperty="Opacity"
                                 Storyboard.TargetName="Root" />
              </Storyboard>
            </VisualTransition>
          </VisualStateGroup.Transitions>
          <VisualState x:Name="Closed">
            <Storyboard>
              <DoubleAnimation Duration="0"
                               To="0"
                               Storyboard.TargetProperty="Opacity"
                               Storyboard.TargetName="Root" />
            </Storyboard>
          </VisualState>
          <VisualState x:Name="Open">
            <Storyboard>
              <DoubleAnimation Duration="0"
                               To="0"
                               Storyboard.TargetProperty="X"
                               Storyboard.TargetName="xform" />
              <DoubleAnimation Duration="0"
                               To="1"
                               Storyboard.TargetProperty="Opacity"
                               Storyboard.TargetName="Root" />
            </Storyboard>
          </VisualState>
        </VisualStateGroup>
      </VisualStateManager.VisualStateGroups>
      <Border Background="#052A2E31"
              CornerRadius="5"
              Margin="4,4,-4,-4" />
      <Border Background="#152A2E31"
              CornerRadius="4"
              Margin="3,3,-3,-3" />
      <Border Background="#252A2E31"
              CornerRadius="3"
              Margin="2,2,-2,-2" />
      <Border Background="#352A2E31"
              CornerRadius="2"
              Margin="1,1,-1,-1" />
      <Border Background="#FFDC000C"
              CornerRadius="2" />
      <Border CornerRadius="2">
        <TextBlock Foreground="White"
                   MaxWidth="250"
                   Margin="8,4,8,4"
                   TextWrapping="Wrap"
                   Text="{Binding (Validation.Errors)[0].ErrorContent}"
                   UseLayoutRounding="false" />
      </Border>
    </Grid>
  </ControlTemplate>

  <Style TargetType="TextBox">
    <Setter Property="BorderThickness"
            Value="1" />
    <Setter Property="Background"
            Value="#FFFFFFFF" />
    <Setter Property="Foreground"
            Value="#FF000000" />
    <Setter Property="Padding"
            Value="2" />
    <Setter Property="BorderBrush">
      <Setter.Value>
        <LinearGradientBrush EndPoint="0.5,1"
                             StartPoint="0.5,0">
          <GradientStop Color="#FFA3AEB9"
                        Offset="0" />
          <GradientStop Color="#FF8399A9"
                        Offset="0.375" />
          <GradientStop Color="#FF718597"
                        Offset="0.375" />
          <GradientStop Color="#FF617584"
                        Offset="1" />
        </LinearGradientBrush>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="TextBox">
          <Grid x:Name="RootElement">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal" />
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <ColorAnimation Duration="0"
                                    To="#FF99C1E2"
                                    Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
                                    Storyboard.TargetName="MouseOverBorder" />
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimation Duration="0"
                                     To="1"
                                     Storyboard.TargetProperty="Opacity"
                                     Storyboard.TargetName="DisabledVisualElement" />
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="ReadOnly">
                  <Storyboard>
                    <DoubleAnimation Duration="0"
                                     To="1"
                                     Storyboard.TargetProperty="Opacity"
                                     Storyboard.TargetName="ReadOnlyVisualElement" />
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <DoubleAnimation Duration="0"
                                     To="1"
                                     Storyboard.TargetProperty="Opacity"
                                     Storyboard.TargetName="FocusVisualElement" />
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unfocused">
                  <Storyboard>
                    <DoubleAnimation Duration="0"
                                     To="0"
                                     Storyboard.TargetProperty="Opacity"
                                     Storyboard.TargetName="FocusVisualElement" />
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ValidationStates">
                <VisualState x:Name="Valid" />
                <VisualState x:Name="InvalidUnfocused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                   Storyboard.TargetName="ValidationErrorElement">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="InvalidFocused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                   Storyboard.TargetName="ValidationErrorElement">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen"
                                                   Storyboard.TargetName="validationTooltip">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <System:Boolean>True</System:Boolean>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="Border"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Background="{TemplateBinding Background}"
                    CornerRadius="1"
                    Opacity="1">
              <Grid>
                <Border x:Name="ReadOnlyVisualElement"
                        Background="#5EC9C9C9"
                        Opacity="0" />
                <Border x:Name="MouseOverBorder"
                        BorderBrush="Transparent"
                        BorderThickness="1">
                  <ScrollViewer x:Name="ContentElement"
                                BorderThickness="0"
                                IsTabStop="False"
                                Padding="{TemplateBinding Padding}" />
                </Border>
              </Grid>
            </Border>
            <Border x:Name="DisabledVisualElement"
                    BorderBrush="#A5F7F7F7"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Background="#A5F7F7F7"
                    IsHitTestVisible="False"
                    Opacity="0" />
            <Border x:Name="FocusVisualElement"
                    BorderBrush="#FF6DBDD1"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    IsHitTestVisible="False"
                    Margin="1"
                    Opacity="0" />
            <Border x:Name="ValidationErrorElement"
                    Visibility="Collapsed"
                    BorderBrush="#FFDB000C"
                    BorderThickness="2"
                    CornerRadius="1">
              <ToolTipService.ToolTip>
                <ToolTip x:Name="validationTooltip"
                         DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                         Placement="Mouse"
                         PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                         Template="{StaticResource ValidationToolTipTemplate}">
                  <ToolTip.Triggers>
                    <EventTrigger RoutedEvent="Canvas.Loaded">
                      <BeginStoryboard>
                        <Storyboard>
                          <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible"
                                                         Storyboard.TargetName="validationTooltip">
                            <DiscreteObjectKeyFrame KeyTime="0">
                              <DiscreteObjectKeyFrame.Value>
                                <System:Boolean>true</System:Boolean>
                              </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                          </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                      </BeginStoryboard>
                    </EventTrigger>
                  </ToolTip.Triggers>
                </ToolTip>
              </ToolTipService.ToolTip>
              <Grid Background="Transparent"
                    HorizontalAlignment="Right"
                    Height="12"
                    Margin="1,-4,-4,0"
                    VerticalAlignment="Top"
                    Width="12">
                <Path Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z"
                      Fill="#FFDC000C"
                      Margin="1,3,0,0" />
                <Path Data="M 0,0 L2,0 L 8,6 L8,8"
                      Fill="#ffffff"
                      Margin="1,3,0,0" />
              </Grid>
            </Border>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="RadioButton">
    <Setter Property="Background"
            Value="#FF448DCA" />
    <Setter Property="Foreground"
            Value="#FF000000" />
    <Setter Property="HorizontalContentAlignment"
            Value="Left" />
    <Setter Property="VerticalContentAlignment"
            Value="Top" />
    <Setter Property="Padding"
            Value="4,1,0,0" />
    <Setter Property="BorderThickness"
            Value="1" />
    <Setter Property="BorderBrush">
      <Setter.Value>
        <LinearGradientBrush EndPoint="0.5,1"
                             StartPoint="0.5,0">
          <GradientStop Color="#FFA3AEB9"
                        Offset="0" />
          <GradientStop Color="#FF8399A9"
                        Offset="0.375" />
          <GradientStop Color="#FF718597"
                        Offset="0.375" />
          <GradientStop Color="#FF617584"
                        Offset="1" />
        </LinearGradientBrush>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="RadioButton">
          <Grid>
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="16" />
              <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal" />
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimation Duration="0"
                                     To="1"
                                     Storyboard.TargetProperty="(UIElement.Effect).(DropShadowEffect.ShadowDepth)"
                                     Storyboard.TargetName="rectangle"
                                     d:IsOptimized="True" />
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Pressed">
                  <Storyboard>
                    <!--DoubleAnimation Duration="0"
                                     To="0.5"
                                     Storyboard.TargetProperty="(UIElement.Opacity)"
                                     Storyboard.TargetName="image"
                                     d:IsOptimized="True" / -->
                    <DoubleAnimation Duration="0"
                                     To="2"
                                     Storyboard.TargetProperty="(UIElement.Effect).(DropShadowEffect.ShadowDepth)"
                                     Storyboard.TargetName="rectangle"
                                     d:IsOptimized="True" />
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimation Duration="0"
                                     To=".55"
                                     Storyboard.TargetProperty="(UIElement.Opacity)"
                                     Storyboard.TargetName="contentPresenter" />
                    <DoubleAnimation Duration="0"
                                     To="0.55"
                                     Storyboard.TargetProperty="(UIElement.Opacity)"
                                     Storyboard.TargetName="DisabledVisualElement" />
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="CheckStates">
                <VisualState x:Name="Checked">
                  <Storyboard>
                    <DoubleAnimation Duration="0"
                                     To="1"
                                     Storyboard.TargetProperty="(UIElement.Opacity)"
                                     Storyboard.TargetName="image"
                                     d:IsOptimized="True" />
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unchecked">
                  <Storyboard>
                    <DoubleAnimation Duration="0"
                                     To="0"
                                     Storyboard.TargetProperty="(UIElement.Opacity)"
                                     Storyboard.TargetName="image"
                                     d:IsOptimized="True" />
</Storyboard>
                	</VisualState>
                <VisualState x:Name="Indeterminate" />
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <DoubleAnimation Duration="0"
                                     To="1"
                                     Storyboard.TargetProperty="Opacity"
                                     Storyboard.TargetName="ContentFocusVisualElement" />
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unfocused" />
              </VisualStateGroup>
              <VisualStateGroup x:Name="ValidationStates">
                <VisualState x:Name="Valid" />
                <VisualState x:Name="InvalidUnfocused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                   Storyboard.TargetName="ValidationErrorElement">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="InvalidFocused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                   Storyboard.TargetName="ValidationErrorElement">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen"
                                                   Storyboard.TargetName="validationTooltip">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <System:Boolean>True</System:Boolean>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid HorizontalAlignment="Left"
                  VerticalAlignment="Top">
              <Rectangle x:Name="rectangle"
                         Stroke="Black"
                         Margin="0,0,2,2"
                         RadiusY="1.708"
                         RadiusX="1.708"
                         Fill="#00000000">
                <Rectangle.Effect>
                  <DropShadowEffect BlurRadius="3"
                                    ShadowDepth="3" />
                </Rectangle.Effect>
              </Rectangle>
              <Image x:Name="image"
                     Margin="1,-3,-1,3"
                     Source="/GiveAQuiz.Common;component/Images/check.png"
                     Stretch="Fill"
                     Opacity="0" />
              <Ellipse x:Name="DisabledVisualElement"
                       Fill="#FFFFFFFF"
                       Opacity="0"
                       Height="14"
                       Width="14" />
              <Ellipse x:Name="ContentFocusVisualElement"
                       Height="16"
                       IsHitTestVisible="false"
                       Opacity="0"
                       Stroke="#FF6DBDD1"
                       StrokeThickness="1"
                       Width="16"
                       d:IsLocked="True" />
              <Grid x:Name="ValidationErrorElement"
                    ToolTipService.PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                    Visibility="Collapsed"
                    d:IsLocked="True">
                <ToolTipService.ToolTip>
                  <ToolTip x:Name="validationTooltip"
                           DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                           Placement="Right"
                           PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                           Template="{StaticResource ValidationToolTipTemplate}">
                    <ToolTip.Triggers>
                      <EventTrigger RoutedEvent="Canvas.Loaded">
                        <BeginStoryboard>
                          <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible"
                                                           Storyboard.TargetName="validationTooltip">
                              <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                  <System:Boolean>true</System:Boolean>
                                </DiscreteObjectKeyFrame.Value>
                              </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                          </Storyboard>
                        </BeginStoryboard>
                      </EventTrigger>
                    </ToolTip.Triggers>
                  </ToolTip>
                </ToolTipService.ToolTip>
                <Ellipse Height="14"
                         Stroke="#FFDB000C"
                         StrokeThickness="1"
                         Width="14" />
                <Ellipse Fill="#FFDB000C"
                         HorizontalAlignment="Right"
                         Height="4"
                         Margin="0,-2,-1,0"
                         VerticalAlignment="Top"
                         Width="4" />
                <Ellipse Fill="Transparent"
                         HorizontalAlignment="Right"
                         Height="10"
                         Margin="0,-5,-4,0"
                         VerticalAlignment="Top"
                         Width="10" />
              </Grid>
            </Grid>
            <ContentPresenter x:Name="contentPresenter"
                              ContentTemplate="{TemplateBinding ContentTemplate}"
                              Content="{TemplateBinding Content}"
                              Grid.Column="1"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                              Margin="{TemplateBinding Padding}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                              d:IsLocked="True" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

</ResourceDictionary>
